<html>
<head><meta charset="utf-8"><title>design meeting 2019.12.02 · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html">design meeting 2019.12.02</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="182377699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182377699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182377699">(Dec 02 2019 at 19:01)</a>:</h4>
<p>Hey <span class="user-group-mention" data-user-group-id="692">@WG-traits</span> -- I probably should have written earlier -- but having just come back from vacation I'm rather discombobulated and not really in a place to have a meeting today. But maybe people can post updates here of interesting things instead, as a lightweight alternative</p>



<a name="182377784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182377784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182377784">(Dec 02 2019 at 19:02)</a>:</h4>
<ul>
<li>I spent some time over vacation sketching out how region handling and polonius could interact, and I've started work on a branch there.</li>
</ul>



<a name="182377803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182377803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182377803">(Dec 02 2019 at 19:02)</a>:</h4>
<ul>
<li>I see there are a lot of PRs on chalk and rust-lang and will try to get to them :)</li>
</ul>



<a name="182377875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182377875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182377875">(Dec 02 2019 at 19:03)</a>:</h4>
<ul>
<li>I also started writing out a kind of map of "all the things" that I think are involved in/around chalk integration etc; i'd like to start trying to put them into a proper document so we can start the process of creating a sort of roadmap.</li>
</ul>



<a name="182379332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379332">(Dec 02 2019 at 19:18)</a>:</h4>
<p>A <em>few</em> of those PRs are from me</p>



<a name="182379390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379390">(Dec 02 2019 at 19:19)</a>:</h4>
<p>A few smaller ones (like adding a regression test)</p>



<a name="182379406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379406">(Dec 02 2019 at 19:19)</a>:</h4>
<p>But also a few bigger ones</p>



<a name="182379435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379435">(Dec 02 2019 at 19:19)</a>:</h4>
<p>All the big one's I think you've seen</p>



<a name="182379533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379533">(Dec 02 2019 at 19:20)</a>:</h4>
<p>Definitely I think look at <a href="https://github.com/rust-lang/chalk/pull/294" target="_blank" title="https://github.com/rust-lang/chalk/pull/294">https://github.com/rust-lang/chalk/pull/294</a>, since rust-analyzer is currently using my branch</p>



<a name="182379577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379577">(Dec 02 2019 at 19:21)</a>:</h4>
<p>But we can talk about PRs elsewhere</p>



<a name="182379602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379602">(Dec 02 2019 at 19:21)</a>:</h4>
<p>But, I have also been thinking about <a href="https://github.com/rust-lang/chalk/issues/234" target="_blank" title="https://github.com/rust-lang/chalk/issues/234">https://github.com/rust-lang/chalk/issues/234</a></p>



<a name="182379620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379620">(Dec 02 2019 at 19:21)</a>:</h4>
<p>And have been playing around with it locally</p>



<a name="182379631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379631">(Dec 02 2019 at 19:21)</a>:</h4>
<p>(so this is more of a design topic)</p>



<a name="182379701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379701">(Dec 02 2019 at 19:22)</a>:</h4>
<p>And probably worth a Hackmd doc</p>



<a name="182379770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379770">(Dec 02 2019 at 19:22)</a>:</h4>
<p>But just generally, I more or less started thinking from your comments on that issue</p>



<a name="182379798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379798">(Dec 02 2019 at 19:23)</a>:</h4>
<p>But I think the "proper" solution will end up being actually a mix of what you suggest</p>



<a name="182379831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182379831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182379831">(Dec 02 2019 at 19:23)</a>:</h4>
<p>So, for brevity, I'll just pose a few questions/thoughts:</p>



<a name="182380076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182380076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182380076">(Dec 02 2019 at 19:26)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> I was thinking about the "no recursion" change -- one thing that I think is suspicious in the PR (but also in master) is that it is definitely possible to wind up with an answer that "refines" a previous answer -- i.e., where a previous answer was ambig, the new answer might not be.</p>



<a name="182380085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182380085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182380085">(Dec 02 2019 at 19:26)</a>:</h4>
<p>It's also possible to have the same answer appear multiple times with different region constraints.</p>



<a name="182380093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182380093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182380093">(Dec 02 2019 at 19:26)</a>:</h4>
<p>I was thinking that the current handling for this is probably not very good</p>



<a name="182380097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182380097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182380097">(Dec 02 2019 at 19:26)</a>:</h4>
<p>I believe your PR simply panics in this situation?</p>



<a name="182380102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182380102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182380102">(Dec 02 2019 at 19:26)</a>:</h4>
<p>And that therefore we have no tests that exercise these paths?</p>



<a name="182380251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182380251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182380251">(Dec 02 2019 at 19:29)</a>:</h4>
<p>Chalk needs more tests in general (though rust-analyzer is doing a good job at uncovering bugs atm)</p>



<a name="182380309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182380309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182380309">(Dec 02 2019 at 19:29)</a>:</h4>
<ol>
<li>Why do we need a separate <code>ProjectionEq</code> and <code>Normalize</code>?</li>
<li>Do we really need a separate idea for <code>Projection</code> and <code>Placeholder type</code>?</li>
<li>Going off that, when we think about projections, I think you're right that we should also sort of <code>associate</code> a normalized value (or an inference variable) to it</li>
<li>When we generate an answer to a <code>ProjectionEq</code>, that answer should I think take the form of <code>Projection *as* </code>Ty<code>. This is important because if there are two *known* answers like </code>&lt;S as Trait1&gt;::Item = u32<code> and </code>&lt;T as Trait1&gt;::Item == i32<code>, if we don't keep the information of the projection around for aggregation, then this could give an </code>ambiguous<code> answer, rather than </code>&lt;?0 as Trait1&gt;::Item`</li>
</ol>



<a name="182380382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182380382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182380382">(Dec 02 2019 at 19:30)</a>:</h4>
<p>Especially ra's <code>analysis-stats</code>, which finds bugs like <a href="https://github.com/rust-lang/chalk/issues/301" target="_blank" title="https://github.com/rust-lang/chalk/issues/301">#301</a></p>



<a name="182380471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182380471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182380471">(Dec 02 2019 at 19:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> um, yes my branch would panic. But so would master.</p>



<a name="182380606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182380606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182380606">(Dec 02 2019 at 19:32)</a>:</h4>
<p>Just mine panics when the answer would have been inserted, master will panic later (I'll have to hunt down the code, but it essentially assumes that the index increases by one when that method returns <code>true</code>, indicating an answer was inserted)</p>



<a name="182380637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182380637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182380637">(Dec 02 2019 at 19:33)</a>:</h4>
<p>There are no tests that exercise this path</p>



<a name="182381065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182381065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182381065">(Dec 02 2019 at 19:37)</a>:</h4>
<p>As far as tests, I'm not sure really the best approach with that. Because, it's not like there's an obvious area where we lack tests, it's just more that the tests that are there don't cover the cases they test <em>fully</em>. So, probably the best approach is to, as bug reports happens, really think about other similar tests that could be added too.</p>



<a name="182381286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182381286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182381286">(Dec 02 2019 at 19:39)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> yeah I think the thing to do is to file a follow-up issue, I might try to craft some tests that show the error path-way.</p>



<a name="182381402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182381402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182381402">(Dec 02 2019 at 19:40)</a>:</h4>
<p>As for the way to handle normalization, that is indeed a complex topic, I've written some notes on it. I don't know what I think the best way to handle it is but it should be impossible to get <code>&lt;S as Foo&gt;::Item</code> to normalize to two distinct types (that is a language bug, if that is possible)</p>



<a name="182381450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182381450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182381450">(Dec 02 2019 at 19:41)</a>:</h4>
<p>At the moment the disaggregator obviously doesn't handle such cases optimally, there's a bug filed on it, I was thinking that the best way might be for it to check -- if it sees a projection type and a normal type, it could cerainly do a query to see if the former normalizes to the latter -- but I'm not crazy about this answer.</p>



<a name="182381463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182381463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182381463">(Dec 02 2019 at 19:41)</a>:</h4>
<p>Did you see my comment on the topic? I can go try to find it</p>



<a name="182381572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182381572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182381572">(Dec 02 2019 at 19:42)</a>:</h4>
<p>That might be a good "design meeting" topic, or just an ad-hoc meeting -- to talk ove the current strategy and kind of explain it and explore some of the alternatives I see</p>



<a name="182382432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182382432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182382432">(Dec 02 2019 at 19:52)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I can file a followup issue for the error path</p>



<a name="182382502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182382502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182382502">(Dec 02 2019 at 19:52)</a>:</h4>
<p>And yes, the comments were in the issue that I linked</p>



<a name="182382530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182382530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182382530">(Dec 02 2019 at 19:52)</a>:</h4>
<p>starting here: <a href="https://github.com/rust-lang/chalk/issues/234#issuecomment-528109851" target="_blank" title="https://github.com/rust-lang/chalk/issues/234#issuecomment-528109851">https://github.com/rust-lang/chalk/issues/234#issuecomment-528109851</a></p>



<a name="182382694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182382694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182382694">(Dec 02 2019 at 19:54)</a>:</h4>
<p>And yes, the projection shouldn't normalize to two distinct types, but there may be multiple answers like <code>&lt;S as Foo&gt;...</code> and <code>&lt;T as Foo&gt;...</code></p>



<a name="182383161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182383161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182383161">(Dec 02 2019 at 19:59)</a>:</h4>
<p>And I think rather than having the <code>ProjectionEq</code> goal generate two separate clauses (<code>Normalize...</code> and the placeholder type), it just generates one <code>&lt;?0 as Foo&gt;::Item is ?1</code> (where here I'm using "is" to say <code>&lt;?0 as Foo&gt;::Item</code> normalizes to <code>?1</code>). Then the answers would be like <code>&lt;S as Foo&gt;::Item is u32</code> and <code>&lt;T as Foo&gt;::Item is i32</code>. Or if we don't know what <code>?1</code> could be, we can also end up with <code>&lt;!1_0 as Foo&gt;::Item is ?0</code> and this is equivalent to the placeholder type used today</p>



<a name="182383313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182383313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182383313">(Dec 02 2019 at 20:00)</a>:</h4>
<p>Of course, it seems a bit convoluted with the example, since there aren't other parameters, but you could imagine that this pattern follows</p>



<a name="182383407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182383407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182383407">(Dec 02 2019 at 20:01)</a>:</h4>
<p>Like I said, I've played around a bit and got it so it "works", but it's not 100% correct and not all tests are passing. But the idea is good I think</p>



<a name="182383414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182383414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182383414">(Dec 02 2019 at 20:01)</a>:</h4>
<p>As for a update from me: I started with a QuantifiedTy/QuantifiedApply refactor, and I'm looking at that panic that RA uncovered. For both, I'm running into the common theme that I don't understand what the code is (or should be) doing, so I'm putting some time in debugging stuff (with println's mostly, not a debugger), and I guess I should get into the habit of running examples through Chalki as well.</p>



<a name="182383519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182383519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182383519">(Dec 02 2019 at 20:02)</a>:</h4>
<p><code>CHALK_DEBUG=2</code> (or <code>1</code>) is fantastic</p>



<a name="182383689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182383689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182383689">(Dec 02 2019 at 20:03)</a>:</h4>
<p>Ah, that's helpful (and should really be documented somewhere). Is 2 just more verbose?</p>



<a name="182383833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182383833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182383833">(Dec 02 2019 at 20:04)</a>:</h4>
<p>Yeah, 2 is much more verbose</p>



<a name="182383913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182383913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182383913">(Dec 02 2019 at 20:05)</a>:</h4>
<p>yeah, it's not really documented, but the <code>debug!(...)</code> statements are <code>2</code> and <code>info!(...)</code> is <code>1</code></p>



<a name="182384260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182384260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182384260">(Dec 02 2019 at 20:09)</a>:</h4>
<p>Heh, yeah that's quite some output</p>



<a name="182385372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182385372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182385372">(Dec 02 2019 at 20:21)</a>:</h4>
<p>one thing I was considering was trying to port chalk's debug output to use the tracing module, which <span class="user-mention" data-user-id="198819">@David Barsky</span> has been telling me is very cool</p>



<a name="182385400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182385400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182385400">(Dec 02 2019 at 20:21)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> and I were talking the other day about how to improve chalk's docs</p>



<a name="182385410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182385410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182385410">(Dec 02 2019 at 20:21)</a>:</h4>
<p>seems like we need to include <code>CHALK_DEBUG</code> for sure.</p>



<a name="182385631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182385631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182385631">(Dec 02 2019 at 20:24)</a>:</h4>
<p>I left a comment on the issue mentioning chalk book we remember later</p>



<a name="182385839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182385839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182385839">(Dec 02 2019 at 20:26)</a>:</h4>
<p>That is one slight "regression" in the non-recursive branch is you no longer get the nested debug statements. But you gain a bit finer tracing. That just would require touching the <code>chalk_macros</code> crate to enable storing the <code>Indent</code> struct on the <code>stack</code></p>



<a name="182385857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182385857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182385857">(Dec 02 2019 at 20:26)</a>:</h4>
<p>not difficult, but not something I wanted to touch</p>



<a name="182386067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182386067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182386067">(Dec 02 2019 at 20:28)</a>:</h4>
<blockquote>
<p>seems like we need to include <code>CHALK_DEBUG</code> for sure.</p>
</blockquote>
<p>Yeah, I'll get a PR up to make CONTRIBUTING.md slightly less outdated <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="182386131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182386131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182386131">(Dec 02 2019 at 20:29)</a>:</h4>
<p>Also, <em>nudge</em> <a href="https://github.com/rust-lang/chalk/issues/299" target="_blank" title="https://github.com/rust-lang/chalk/issues/299">https://github.com/rust-lang/chalk/issues/299</a></p>



<a name="182386364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182386364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182386364">(Dec 02 2019 at 20:31)</a>:</h4>
<p>Or set up tracing so you can exclude those added clauses, if that's possible</p>



<a name="182386508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182386508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182386508">(Dec 02 2019 at 20:33)</a>:</h4>
<p>It would be very cool if you could selectively get logging output from certain kinds of rules, while still running chalk like normal</p>



<a name="182386678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182386678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182386678">(Dec 02 2019 at 20:34)</a>:</h4>
<p>The only problem is then how do you exclude subgoals</p>



<a name="182386708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182386708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182386708">(Dec 02 2019 at 20:35)</a>:</h4>
<p>I guess you would have to "switch off" logging at a given stack depth</p>



<a name="182411815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182411815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> David Barsky <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182411815">(Dec 03 2019 at 02:59)</a>:</h4>
<p>Bit of a late response, but: <code>tracing</code> is best used if you annotate all the units of work in an application/library (using a span: <a href="https://tracing.rs/tracing/span/index.html" target="_blank" title="https://tracing.rs/tracing/span/index.html">https://tracing.rs/tracing/span/index.html</a>; syntax sugar also available: <a href="https://tracing.rs/tracing_attributes/attr.instrument.html" target="_blank" title="https://tracing.rs/tracing_attributes/attr.instrument.html">https://tracing.rs/tracing_attributes/attr.instrument.html</a>). once you do, any data that's recorded can be filtered on, queried over, or switched on/off.</p>



<a name="182411835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182411835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> David Barsky <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182411835">(Dec 03 2019 at 02:59)</a>:</h4>
<p>So to answer: </p>
<blockquote>
<p>It would be very cool if you could selectively get logging output from certain kinds of rules, while still running chalk like normal</p>
</blockquote>
<p><code>tracing</code> would let you do that, if you annotate those rules in a way that <code>tracing</code> can understand (whether that be via a string, module, or whatever)</p>



<a name="182411922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/design%20meeting%202019.12.02/near/182411922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> David Barsky <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/design.20meeting.202019.2E12.2E02.html#182411922">(Dec 03 2019 at 03:01)</a>:</h4>
<p>Eliza had a neat blog post that demonstrated this in the context of a service: <a href="https://tokio.rs/blog/2019-08-tracing" target="_blank" title="https://tokio.rs/blog/2019-08-tracing">https://tokio.rs/blog/2019-08-tracing</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>